import request from '@/router/axios'

export function getLevelSetting(obj) {  // 查询等级列表
  return request({
    url: '/api/loyalty/levelSetting/old',
    method: 'post',
    data:obj
  })
}

export function fetchgradeList(obj) {  // 查询等级列表
    return request({
      url: '/api/loyalty/levelRule/list',
      method: 'post',
      data:obj
    })
}

export function saveLevelSetting(obj) {  //保存设置
    return request({
      url: '/api/loyalty/levelSetting',
      method: 'post',
      data:obj
    })
}

export function deletegrade(id) {  // 删除等级
    return request({
      url: '/api/loyalty/levelRule/'+id,
      method: 'delete'
    })
}

export function savegrade(obj) {  // 编辑等级列表
  return request({
    url: '/api/loyalty/levelRule',
    method: 'post',
    data:obj
  })
}

export function getLevelRuleById(id) {  // 编辑等级列表
  return request({
    url: '/api/loyalty/levelRule/'+id,
    method: 'get'
  })
}
